package com.example.demo.config.login;

import com.example.demo.datasource.multi.dao.usermapper;
import com.example.demo.datasource.multi.entity.user;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;

@Slf4j
@Service
public class userService {

    @Autowired
    usermapper usermapper;
    @Autowired
    user user;

    public Map<String, String> getUser(String name){

        Map<String,String> theresult=new HashMap();

        String sql="select * from user where username = '"+name+"'";
        user theuser=usermapper.getuser(sql);
        theresult.put("username",theuser.getUsername());
        theresult.put("password",theuser.getPassword());
        theresult.put("code","200");

        log.info("获取密码："+theuser.getPassword());
        System.out.println("获取密码："+theuser.getPassword());
        System.out.println("返回结果："+theresult);
        log.info("返回结果："+theresult);

        return theresult;

    }
}
